feat: add --no-ui flag to serve command to disable web UI#11
Conversation
Code Review: PR #11 —
|
When --no-ui is passed to `code-iq serve`, the React SPA is excluded and only the REST API and MCP server remain active. Useful for headless or CI environments. - CodeIqApplication.main() detects --no-ui before Spring context init and sets codeiq.ui.enabled=false as a system property - SpaController gains @ConditionalOnProperty so it is only registered when codeiq.ui.enabled=true (default: true / matchIfMissing=true) - CodeIqConfig gains uiEnabled field bound to codeiq.ui.enabled - application.yml sets codeiq.ui.enabled: true as default - ServeCommand: added --no-ui option; startup log now states whether Web UI is enabled or disabled - Tests: 2 new --no-ui flag tests in ServeCommandTest, 5 new SpaControllerConditionalTest tests (1447 total, 0 failures) Co-Authored-By: Paperclip <noreply@paperclip.ing>
…ller routes - CodeIqApplication: set spring.web.resources.add-mappings=false when --no-ui is active, preventing static file serving (index.html, JS, CSS bundles) - SpaController: replace stale /topology and /flow routes with /graph (matches the current Code Graph treemap tab added in 482ca24) - SpaControllerConditionalTest: add staticResourcesDisabledWhenUiDisabled test and spaControllerExplicitRoutesContainGraph test (1449 total, 0 failures) Co-Authored-By: Paperclip <noreply@paperclip.ing>
…-no-ui flag The arg parser incorrectly set skipNext=true for ALL --flag patterns, causing code-iq serve --no-ui /repo to silently drop /repo (treating it as the value of --no-ui). Boolean flags that take no value must not consume the next token. - Added BOOLEAN_FLAGS set (--no-ui, --help, -h, --version) to CodeIqApplication - extractPositionalArg now skips skipNext for flags in BOOLEAN_FLAGS - Added pathNotSwallowedWhenNoUiPrecedesPath test to ServeCommandTest - Added CodeIqApplicationArgParsingTest with 5 reflection-based unit tests for extractPositionalArg edge cases Co-Authored-By: Paperclip <noreply@paperclip.ing>
9f12558 to
0c51354
Compare
|


Summary
--no-uiflag tocode-iq servethat disables the React SPA while keeping REST API and MCP endpoints fully active@ConditionalOnPropertyonSpaControllerso it is excluded from the Spring context whencodeiq.ui.enabled=falseCodeIqApplication.main()before Spring initializes (same pattern as--portand--graphflags)Changes
CodeIqApplication.java— detect--no-uiarg and setcodeiq.ui.enabled=falsesystem property before Spring contextSpaController.java— add@ConditionalOnProperty(name = "codeiq.ui.enabled", havingValue = "true", matchIfMissing = true)CodeIqConfig.java— adduiEnabledfield bound tocodeiq.ui.enabledapplication.yml— defaultcodeiq.ui.enabled: trueServeCommand.java— add--no-uioption; differentiated startup logServeCommandTest.java— 2 new tests (noUiDefaultsToFalse,noUiFlagIsRecognized)SpaControllerConditionalTest.java— 5 new tests verifying annotation metadata and conditional bean registrationTest plan
ServeCommandTest— 7 tests, all passSpaControllerConditionalTest— 5 tests: verifies bean absent whencodeiq.ui.enabled=false, present whentrueor absentAcceptance criteria met
code-iq serve --no-ui /path/to/repostarts without registering SpaControllerGET /topology,/exploreretc. return 404 when--no-uiis active (SpaController not registered)GET /api/statsstill works when--no-uiis activeGET /mcpstill works when--no-uiis activecode-iq serve /path/to/repo(without flag) works as beforeCloses RAN-52
🤖 Generated with Claude Code